package com.cjm.one.goods.client;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cjm.one.common.constant.ServerConstants;
import com.cjm.one.common.result.Result;
import com.cjm.one.model.goods.entity.GoodsBrand;
import com.cjm.one.model.goods.vo.GoodsBrandVo;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;

@FeignClient(value = ServerConstants.SERVER_ONE_GOODS)
public interface GoodsBrandClient {
    @GetMapping("/admin/goods/brand/list")
    @Operation(summary = "分页查询" )
    Result<Page<GoodsBrandVo>> page(@RequestParam(name = "current", defaultValue = "1") Integer current,
                                    @RequestParam(name = "size", defaultValue = "10") Integer size
            , @RequestParam(name = "name",required = false) String name);
    @GetMapping("/admin/goods/brand/{id}")
    @Operation(summary = "根据id查询" )
    Result<GoodsBrandVo> getById(@PathVariable(name = "id") Long id);
    @PostMapping("/admin/goods/brand")
    @Operation(summary = "新增" )
    Result<Boolean> save(@RequestBody GoodsBrand goodBrand);

    @PutMapping("/admin/goods/brand")
    @Operation(summary = "修改" )
    Result<Boolean> update(@RequestBody GoodsBrand goodBrand);

    @DeleteMapping("/admin/goods/brand/{id}")
    @Operation(summary = "删除" )
    Result<Boolean> delete(@PathVariable(name = "id") Long id);
    @GetMapping("/admin/goods/brand/list/all")
    @Operation(summary = "查询所有" )
    Result<ArrayList<GoodsBrandVo>> listAll();

}
